#include <stdio.h>
#include "prescheme.h"
#include "scheme48vm-prelude.h"
#include "scheme48vm.h"
#include "scheme48heap.h"

struct image_location {
  long new_descriptor;
  long next;
};
struct table {
  long *keys;
  struct image_location **values;
  long count;
  long size;
};
static struct image_location *table_ref(struct table*, long);
static char resumer_recordP(long);
static long trace_image_value(long);
long s48_write_image(long, long, FILE *);
static long SstatusS;
static FILE * Simage_portS;
static char * Simage_bufferS;
static char * Simage_buffer_pointerS;
static struct table *Sstob_tableS;
static long Sfirst_stobS;
static struct image_location *Slast_stobS;
static char * Simage_beginS;
static char * Simage_hpS;
static long Sresumer_countS;
static long Sresumer_recordsS;
static long Sundumpable_recordsS;
static long Sundumpable_countS;

static struct image_location *table_ref(struct table *table_0X, long key_1X)
{
  long arg0K0;
  long next_5X;
  long i_4X;
  long *keys_3X;
  long size_2X;
 {  if ((0 < (table_0X->size))) {
    size_2X = table_0X->size;
    keys_3X = table_0X->keys;
    arg0K0 = ((key_1X ^ ((((key_1X)<<1)) ^ (((key_1X)>>10)))) & (-1 + size_2X));
    goto L1568;}
  else {
    return (NULL);}}
 L1568: {
  i_4X = arg0K0;
  next_5X = *(keys_3X + i_4X);
  if ((key_1X == next_5X)) {
    return (*((table_0X->values) + i_4X));}
  else {
    if ((0 == next_5X)) {
      if ((i_4X == (table_0X->size))) {
        arg0K0 = 0;
        goto L1568;}
      else {
        return (NULL);}}
    else {
      arg0K0 = (1 + i_4X);
      goto L1568;}}}
}
static char resumer_recordP(long stob_6X)
{
  long type_7X;
 {  if ((3 == (3 & stob_6X))) {
    if ((9 == (31 & ((((*((long *) ((((char *) (-3 + stob_6X))) + -4))))>>2))))) {
      type_7X = *((long *) (((char *) (-3 + stob_6X))));
      if ((3 == (3 & type_7X))) {
        if ((9 == (31 & ((((*((long *) ((((char *) (-3 + type_7X))) + -4))))>>2))))) {
          return (3 == (3 & (*((long *) ((((char *) (-3 + type_7X))) + 4)))));}
        else {
          return 0;}}
      else {
        return 0;}}
    else {
      return 0;}}
  else {
    return 0;}}
}
static long trace_image_value(long thing_8X)
{
  long arg0K0;
  struct image_location *arg1K0;
  struct image_location *merged_arg1K2;
  long merged_arg0K0;
  long merged_arg0K1;
  struct table *merged_arg2K0;

  int table_setB_return_tag;
  int gc_recordP_return_tag;
  char gc_recordP0_return_value;
  struct table *table_9X;
  long key_10X;
  struct image_location *value_11X;
  long x_12X;
  long i_46X;
  struct image_location *value_45X;
  long key_44X;
  long i_43X;
  long i_42X;
  struct image_location **new_values_41X;
  long *new_keys_40X;
  long new_size_39X;
  long old_size_38X;
  long *old_keys_37X;
  struct image_location **old_values_36X;
  long next_35X;
  long i_34X;
  long *keys_33X;
  long size_32X;
  long header_31X;
  char v_30X;
  long x_29X;
  struct image_location *new_28X;
  struct image_location *new_27X;
  struct image_location *image_location_26X;
  long new_descriptor_25X;
  char * data_addr_24X;
  long h_23X;
  long stob_22X;
  struct image_location *image_location_21X;
  long new_alias_20X;
  long i_19X;
  long len_18X;
  long vector_17X;
  char v_16X;
  long type_15X;
  char v_14X;
  struct image_location *have_13X;
 {  if ((3 == (3 & thing_8X))) {
    have_13X = table_ref((Sstob_tableS), thing_8X);
    if ((NULL == have_13X)) {
      merged_arg0K0 = thing_8X;
      gc_recordP_return_tag = 0;
      goto gc_recordP;
     gc_recordP_return_0:
      v_14X = gc_recordP0_return_value;
      if (v_14X) {
        type_15X = *((long *) (((char *) (-3 + thing_8X))));
        merged_arg0K0 = type_15X;
        gc_recordP_return_tag = 1;
        goto gc_recordP;
       gc_recordP_return_1:
        v_16X = gc_recordP0_return_value;
        if (v_16X) {
          if ((1 == (*((long *) ((((char *) (-3 + type_15X))) + 4))))) {
            if (((Sundumpable_countS) < ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + (Sundumpable_recordsS)))) + -4))))>>8))))>>2)))) {
              vector_17X = Sundumpable_recordsS;
              len_18X = (((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + vector_17X))) + -4))))>>8))))>>2);
              arg0K0 = 0;
              goto L3781;}
            else {
              goto L5024;}}
          else {
            arg0K0 = thing_8X;
            goto L4132;}}
        else {
          arg0K0 = thing_8X;
          goto L4132;}}
      else {
        arg0K0 = thing_8X;
        goto L4132;}}
    else {
      return (have_13X->new_descriptor);}}
  else {
    return thing_8X;}}
 L3781: {
  i_19X = arg0K0;
  if ((i_19X == len_18X)) {
    *((long *) ((((char *) (-3 + (Sundumpable_recordsS)))) + ((((Sundumpable_countS))<<2)))) = (long) (thing_8X);
    Sundumpable_countS = (1 + (Sundumpable_countS));
    goto L5024;}
  else {
    if (((*((long *) ((((char *) (-3 + vector_17X))) + (((i_19X)<<2))))) == thing_8X)) {
      goto L5024;}
    else {
      arg0K0 = (1 + i_19X);
      goto L3781;}}}
 L5024: {
  new_alias_20X = trace_image_value((*((long *) ((((char *) (-3 + thing_8X))) + 4))));
  image_location_21X = (struct image_location*)malloc(sizeof(struct image_location));
  if ((NULL == image_location_21X)) {
    arg1K0 = image_location_21X;
    goto L5028;}
  else {
    image_location_21X->new_descriptor = new_alias_20X;
    image_location_21X->next = 0;
    arg1K0 = image_location_21X;
    goto L5028;}}
 L4132: {
  stob_22X = arg0K0;
  h_23X = *((long *) ((((char *) (-3 + stob_22X))) + -4));
  data_addr_24X = (Simage_hpS) + 4;
  Simage_hpS = (data_addr_24X + (-4 & (3 + ((long)(((unsigned long)h_23X)>>8)))));
  new_descriptor_25X = 3 + (((long) data_addr_24X));
  image_location_26X = (struct image_location*)malloc(sizeof(struct image_location));
  if ((NULL == image_location_26X)) {
    arg1K0 = image_location_26X;
    goto L4142;}
  else {
    image_location_26X->new_descriptor = new_descriptor_25X;
    image_location_26X->next = 0;
    arg1K0 = image_location_26X;
    goto L4142;}}
 L5028: {
  new_27X = arg1K0;
  if ((NULL == new_27X)) {
    (Sstob_tableS)->size = 0;
    return new_alias_20X;}
  else {
    merged_arg2K0 = (Sstob_tableS);
    merged_arg0K1 = thing_8X;
    merged_arg1K2 = new_27X;
    table_setB_return_tag = 0;
    goto table_setB;
   table_setB_return_0:
    return new_alias_20X;}}
 L4142: {
  new_28X = arg1K0;
  if ((NULL == new_28X)) {
    (Sstob_tableS)->size = 0;
    return new_descriptor_25X;}
  else {
    x_29X = Sfirst_stobS;
    if ((1 == x_29X)) {
      Sfirst_stobS = stob_22X;
      goto L4161;}
    else {
      (Slast_stobS)->next = stob_22X;
      goto L4161;}}}
 L4161: {
  Slast_stobS = new_28X;
  new_28X->next = 1;
  merged_arg2K0 = (Sstob_tableS);
  merged_arg0K1 = stob_22X;
  merged_arg1K2 = new_28X;
  table_setB_return_tag = 1;
  goto table_setB;
 table_setB_return_1:
  v_30X = resumer_recordP(stob_22X);
  if (v_30X) {
    Sresumer_countS = (1 + (Sresumer_countS));
    return new_descriptor_25X;}
  else {
    return new_descriptor_25X;}}
 gc_recordP: {
  x_12X = merged_arg0K0;{
  if ((3 == (3 & x_12X))) {
    header_31X = *((long *) ((((char *) (-3 + x_12X))) + -4));
    if ((3 == (3 & header_31X))) {
      if ((3 == (3 & header_31X))) {
        gc_recordP0_return_value = (9 == (31 & ((((*((long *) ((((char *) (-3 + header_31X))) + -4))))>>2))));
        goto gc_recordP_return;}
      else {
        gc_recordP0_return_value = 0;
        goto gc_recordP_return;}}
    else {
      if ((3 == (3 & x_12X))) {
        gc_recordP0_return_value = (9 == (31 & ((((*((long *) ((((char *) (-3 + x_12X))) + -4))))>>2))));
        goto gc_recordP_return;}
      else {
        gc_recordP0_return_value = 0;
        goto gc_recordP_return;}}}
  else {
    gc_recordP0_return_value = 0;
    goto gc_recordP_return;}}
 gc_recordP_return:
  switch (gc_recordP_return_tag) {
  case 0: goto gc_recordP_return_0;
  default: goto gc_recordP_return_1;
  }}

 table_setB: {
  table_9X = merged_arg2K0;
  key_10X = merged_arg0K1;
  value_11X = merged_arg1K2;{
  if ((0 < (table_9X->size))) {
    size_32X = table_9X->size;
    keys_33X = table_9X->keys;
    arg0K0 = ((key_10X ^ ((((key_10X)<<1)) ^ (((key_10X)>>10)))) & (-1 + size_32X));
    goto L2663;}
  else {
    goto table_setB_return;}}
 L2663: {
  i_34X = arg0K0;
  next_35X = *(keys_33X + i_34X);
  if ((key_10X == next_35X)) {
    *((table_9X->values) + i_34X) = value_11X;
    goto table_setB_return;}
  else {
    if ((0 == next_35X)) {
      if ((i_34X == (table_9X->size))) {
        arg0K0 = 0;
        goto L2663;}
      else {
        *((table_9X->keys) + i_34X) = key_10X;
        *((table_9X->values) + i_34X) = value_11X;
        table_9X->count = (1 + (table_9X->count));
        if (((table_9X->count) == ((table_9X->size) / 3))) {
          old_values_36X = table_9X->values;
          old_keys_37X = table_9X->keys;
          old_size_38X = table_9X->size;
          new_size_39X = (((table_9X->size))<<1);
          new_keys_40X = (long*)malloc(sizeof(long) * (1 + new_size_39X));
          new_values_41X = (struct image_location**)malloc(sizeof(struct image_location*) * new_size_39X);
          if ((NULL == new_keys_40X)) {
            goto L1841;}
          else {
            if ((NULL == new_values_41X)) {
              goto L1841;}
            else {
              table_9X->keys = new_keys_40X;
              table_9X->values = new_values_41X;
              table_9X->size = new_size_39X;
              table_9X->count = 0;
              arg0K0 = 0;
              goto L1994;}}}
        else {
          goto table_setB_return;}}}
    else {
      arg0K0 = (1 + i_34X);
      goto L2663;}}}
 L1841: {
  if ((NULL == new_keys_40X)) {
    goto L1849;}
  else {
    free(new_keys_40X);
    goto L1849;}}
 L1994: {
  i_42X = arg0K0;
  if ((i_42X < (1 + new_size_39X))) {
    *(new_keys_40X + i_42X) = 0;
    arg0K0 = (1 + i_42X);
    goto L1994;}
  else {
    arg0K0 = 0;
    goto L1872;}}
 L1849: {
  if ((NULL == new_values_41X)) {
    goto L1857;}
  else {
    free(new_values_41X);
    goto L1857;}}
 L1872: {
  i_43X = arg0K0;
  if ((i_43X == old_size_38X)) {
    free(old_keys_37X);
    free(old_values_36X);
    goto table_setB_return;}
  else {
    key_44X = *(old_keys_37X + i_43X);
    if ((0 == key_44X)) {
      goto L1888;}
    else {
      value_45X = *(old_values_36X + i_43X);
      arg0K0 = ((key_44X ^ ((((key_44X)<<1)) ^ (((key_44X)>>10)))) & (-1 + new_size_39X));
      goto L2016;}}}
 L1857: {
  table_9X->size = 0;
  goto table_setB_return;}
 L1888: {
  arg0K0 = (1 + i_43X);
  goto L1872;}
 L2016: {
  i_46X = arg0K0;
  if ((0 == (*(new_keys_40X + i_46X)))) {
    if ((i_46X == new_size_39X)) {
      arg0K0 = 0;
      goto L2016;}
    else {
      *(new_keys_40X + i_46X) = key_44X;
      *(new_values_41X + i_46X) = value_45X;
      goto L1888;}}
  else {
    arg0K0 = (1 + i_46X);
    goto L2016;}}
 table_setB_return:
  switch (table_setB_return_tag) {
  case 0: goto table_setB_return_0;
  default: goto table_setB_return_1;
  }}

}
long s48_write_image(long resume_proc_47X, long undumpables_48X, FILE * port_49X)
{
  struct table *arg2K0;
  long arg0K0;
  char * arg3K0;
  long merged_arg0K0;
  long merged_arg0K1;
  char * merged_arg3K0;

  int copy_image_data_return_tag;
  int write_descriptor_return_tag;
  int write_shared_table_return_tag;
  char write_shared_table0_return_value;
  char * start_50X;
  long size_51X;
  long descriptor_52X;
  long table_53X;
  long have_192X;
  long have_191X;
  long v_190X;
  long value_189X;
  struct image_location *have_188X;
  long thing_187X;
  long link_186X;
  struct image_location *v_185X;
  long next_184X;
  long shared_183X;
  long link_182X;
  char temp_181X;
  long i_180X;
  long value_179X;
  long v_178X;
  struct image_location *have_177X;
  long v_176X;
  long v_175X;
  struct image_location *have_174X;
  long thing_173X;
  struct image_location *have_172X;
  long thing_171X;
  long x_170X;
  char * addr_169X;
  long v_168X;
  long value_167X;
  struct image_location *have_166X;
  long thing_165X;
  char * addr_164X;
  char * start_163X;
  long header_162X;
  long next_161X;
  struct image_location *have_160X;
  long thing_159X;
  struct image_location *have_158X;
  char * addr_157X;
  long v_156X;
  long link_155X;
  struct image_location *v_154X;
  long next_153X;
  char * start_152X;
  long header_151X;
  long next_150X;
  long value_149X;
  long have_148X;
  long available_147X;
  long size_146X;
  char * start_145X;
  long header_144X;
  long shared_143X;
  long link_142X;
  struct image_location *v_141X;
  long next_140X;
  struct image_location *have_139X;
  long thing_138X;
  long i_137X;
  long link_136X;
  long symbol_135X;
  long v_134X;
  long link_133X;
  struct image_location *v_132X;
  long next_131X;
  long *keys_130X;
  struct image_location **values_129X;
  struct table *table_128X;
  long link_127X;
  struct image_location *have_126X;
  long thing_125X;
  long id_124X;
  char * addr_123X;
  long symbol_122X;
  long have_121X;
  char v_120X;
  struct image_location *location_119X;
  long stob_118X;
  char * start_117X;
  long header_116X;
  struct image_location *have_115X;
  long thing_114X;
  long link_113X;
  long v_112X;
  long v_111X;
  long i_110X;
  struct image_location *v_109X;
  long thing_108X;
  long table_107X;
  struct image_location *location_106X;
  long stob_105X;
  long v_104X;
  long v_103X;
  long v_102X;
  long n_101X;
  long v_100X;
  long n_99X;
  struct image_location *have_98X;
  long thing_97X;
  long v_96X;
  long n_95X;
  struct image_location *have_94X;
  long thing_93X;
  long v_92X;
  long n_91X;
  struct image_location *have_90X;
  long thing_89X;
  long v_88X;
  long v_87X;
  long v_86X;
  long v_85X;
  long v_84X;
  long v_83X;
  long i_82X;
  long v_81X;
  long *keys_80X;
  struct image_location **values_79X;
  struct table *table_78X;
  long v_77X;
  char * data_addr_76X;
  long cells_75X;
  long v_74X;
  long v_73X;
  long v_72X;
  struct image_location *last_71X;
  char * addr_70X;
  long next_69X;
  struct image_location *image_location_68X;
  char * start_67X;
  long link_66X;
  long entry_65X;
  long header_64X;
  long stob_63X;
  long link_62X;
  long i_61X;
  long table_60X;
  long resume_proc_59X;
  struct table *v_58X;
  struct table *table_57X;
  long i_56X;
  long *keys_55X;
  char * start_address_54X;
 {  start_address_54X = ((char *) 0);
  keys_55X = (long*)malloc(sizeof(long) * 4097);
  arg0K0 = 0;
  goto L2584;}
 L2584: {
  i_56X = arg0K0;
  if ((i_56X < 4097)) {
    *(keys_55X + i_56X) = 0;
    arg0K0 = (1 + i_56X);
    goto L2584;}
  else {
    table_57X = (struct table*)malloc(sizeof(struct table));
    if ((NULL == table_57X)) {
      arg2K0 = table_57X;
      goto L2553;}
    else {
      table_57X->keys = keys_55X;
      table_57X->values = ((struct image_location**)malloc(sizeof(struct image_location*) * 4096));
      table_57X->count = 0;
      table_57X->size = 4096;
      arg2K0 = table_57X;
      goto L2553;}}}
 L2553: {
  v_58X = arg2K0;
  Sstob_tableS = v_58X;
  Sfirst_stobS = 1;
  Slast_stobS = (NULL);
  Simage_beginS = start_address_54X;
  Simage_hpS = start_address_54X;
  Sundumpable_recordsS = undumpables_48X;
  Sundumpable_countS = 0;
  Sresumer_countS = 0;
  Simage_portS = port_49X;
  Simage_bufferS = ((char *)malloc(4096));
  Simage_buffer_pointerS = (Simage_bufferS);
  SstatusS = NO_ERRORS;
  if (((Simage_bufferS) == NULL)) {
    return ENOMEM;}
  else {
    resume_proc_59X = trace_image_value(resume_proc_47X);
    table_60X = s48_exported_bindings();
    arg0K0 = 0;
    goto L3381;}}
 L3381: {
  i_61X = arg0K0;
  if ((1024 == i_61X)) {
    arg0K0 = (Sfirst_stobS);
    goto L4822;}
  else {
    link_62X = *((long *) ((((char *) (-3 + table_60X))) + (((i_61X)<<2))));
    if ((0 == (3 & link_62X))) {
      arg0K0 = (3 + (-4 & link_62X));
      goto L3355;}
    else {
      arg0K0 = link_62X;
      goto L3355;}}}
 L4822: {
  stob_63X = arg0K0;
  header_64X = *((long *) ((((char *) (-3 + stob_63X))) + -4));
  if ((2 == (3 & header_64X))) {
    if (((31 & (((header_64X)>>2))) < 17)) {
      goto L4694;}
    else {
      goto L4824;}}
  else {
    goto L4694;}}
 L3355: {
  entry_65X = arg0K0;
  if ((1 == entry_65X)) {
    arg0K0 = (1 + i_61X);
    goto L3381;}
  else {trace_image_value(entry_65X);
    link_66X = *((long *) ((((char *) (-3 + entry_65X))) + 12));
    if ((0 == (3 & link_66X))) {
      arg0K0 = (3 + (-4 & link_66X));
      goto L3355;}
    else {
      arg0K0 = link_66X;
      goto L3355;}}}
 L4694: {
  if ((1078 == header_64X)) {
    goto L4824;}
  else {
    start_67X = ((char *) (-3 + stob_63X));
    arg3K0 = start_67X;
    goto L4713;}}
 L4824: {
  if ((0 < ((Sstob_tableS)->size))) {
    image_location_68X = table_ref((Sstob_tableS), stob_63X);
    next_69X = image_location_68X->next;
    if ((3 == (3 & next_69X))) {
      arg0K0 = next_69X;
      goto L4822;}
    else {
      goto L4893;}}
  else {
    goto L4893;}}
 L4713: {
  addr_70X = arg3K0;
  if ((addr_70X == (start_67X + (-4 & (3 + ((long)(((unsigned long)header_64X)>>8))))))) {
    goto L4824;}
  else {trace_image_value((*((long *) addr_70X)));
    arg3K0 = (addr_70X + 4);
    goto L4713;}}
 L4893: {
  last_71X = Slast_stobS;
  v_72X = s48_symbol_table();trace_image_value(v_72X);
  v_73X = s48_imported_bindings();trace_image_value(v_73X);
  v_74X = s48_exported_bindings();trace_image_value(v_74X);
  last_71X->next = 1;
  cells_75X = Sresumer_countS;
  data_addr_76X = (Simage_hpS) + 4;
  Simage_hpS = (data_addr_76X + (((cells_75X)<<2)));
  Sresumer_recordsS = (3 + (((long) data_addr_76X)));
  if ((0 < ((Sstob_tableS)->size))) {
    if (((SstatusS) == NO_ERRORS)) {
      PS_WRITE_CHAR(10, port_49X, v_77X)
      SstatusS = v_77X;
      goto L2257;}
    else {
      goto L2257;}}
  else {
    table_78X = Sstob_tableS;
    values_79X = table_78X->values;
    keys_80X = table_78X->keys;
    arg0K0 = 0;
    goto L5205;}}
 L2257: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(12, (Simage_portS), v_81X)
    SstatusS = v_81X;
    goto L2259;}
  else {
    goto L2259;}}
 L5205: {
  i_82X = arg0K0;
  if ((i_82X == (table_78X->size))) {
    free(keys_80X);
    free(values_79X);
    free(table_78X);
    free((Simage_bufferS));
    return ENOMEM;}
  else {
    if ((0 == (*(keys_80X + i_82X)))) {
      goto L5207;}
    else {
      free((*(values_79X + i_82X)));
      goto L5207;}}}
 L2259: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, port_49X, v_83X)
    SstatusS = v_83X;
    goto L2268;}
  else {
    goto L2268;}}
 L5207: {
  arg0K0 = (1 + i_82X);
  goto L5205;}
 L2268: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_string("Vanilla 24", port_49X));
    goto L2275;}
  else {
    goto L2275;}}
 L2275: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, port_49X, v_84X)
    SstatusS = v_84X;
    goto L2284;}
  else {
    goto L2284;}}
 L2284: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(4, (Simage_portS)));
    goto L2329;}
  else {
    goto L2329;}}
 L2329: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_85X)
    SstatusS = v_85X;
    goto L2286;}
  else {
    goto L2286;}}
 L2286: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(0, (Simage_portS)));
    goto L2346;}
  else {
    goto L2346;}}
 L2346: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_86X)
    SstatusS = v_86X;
    goto L2290;}
  else {
    goto L2290;}}
 L2290: {
  v_87X = (Simage_hpS) - (Simage_beginS);
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer((((v_87X)>>2)), (Simage_portS)));
    goto L2365;}
  else {
    goto L2365;}}
 L2365: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_88X)
    SstatusS = v_88X;
    goto L2296;}
  else {
    goto L2296;}}
 L2296: {
  thing_89X = s48_symbol_table();
  if ((3 == (3 & thing_89X))) {
    have_90X = table_ref((Sstob_tableS), thing_89X);
    if ((NULL == have_90X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L2383;}
    else {
      goto L2383;}}
  else {
    arg0K0 = thing_89X;
    goto L2300;}}
 L2383: {
  arg0K0 = (have_90X->new_descriptor);
  goto L2300;}
 L2300: {
  n_91X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_91X, (Simage_portS)));
    goto L2393;}
  else {
    goto L2393;}}
 L2393: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_92X)
    SstatusS = v_92X;
    goto L2302;}
  else {
    goto L2302;}}
 L2302: {
  thing_93X = s48_imported_bindings();
  if ((3 == (3 & thing_93X))) {
    have_94X = table_ref((Sstob_tableS), thing_93X);
    if ((NULL == have_94X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L2411;}
    else {
      goto L2411;}}
  else {
    arg0K0 = thing_93X;
    goto L2306;}}
 L2411: {
  arg0K0 = (have_94X->new_descriptor);
  goto L2306;}
 L2306: {
  n_95X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_95X, (Simage_portS)));
    goto L2421;}
  else {
    goto L2421;}}
 L2421: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_96X)
    SstatusS = v_96X;
    goto L2308;}
  else {
    goto L2308;}}
 L2308: {
  thing_97X = s48_exported_bindings();
  if ((3 == (3 & thing_97X))) {
    have_98X = table_ref((Sstob_tableS), thing_97X);
    if ((NULL == have_98X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L2439;}
    else {
      goto L2439;}}
  else {
    arg0K0 = thing_97X;
    goto L2312;}}
 L2439: {
  arg0K0 = (have_98X->new_descriptor);
  goto L2312;}
 L2312: {
  n_99X = arg0K0;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_99X, (Simage_portS)));
    goto L2449;}
  else {
    goto L2449;}}
 L2449: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_100X)
    SstatusS = v_100X;
    goto L2314;}
  else {
    goto L2314;}}
 L2314: {
  n_101X = Sresumer_recordsS;
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(n_101X, (Simage_portS)));
    goto L2463;}
  else {
    goto L2463;}}
 L2463: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_102X)
    SstatusS = v_102X;
    goto L2316;}
  else {
    goto L2316;}}
 L2316: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_integer(resume_proc_59X, (Simage_portS)));
    goto L2477;}
  else {
    goto L2477;}}
 L2477: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(10, (Simage_portS), v_103X)
    SstatusS = v_103X;
    goto L2318;}
  else {
    goto L2318;}}
 L2318: {
  if (((SstatusS) == NO_ERRORS)) {
    PS_WRITE_CHAR(12, (Simage_portS), v_104X)
    SstatusS = v_104X;
    goto L5110;}
  else {
    goto L5110;}}
 L5110: {
  merged_arg0K0 = 1;
  write_descriptor_return_tag = 0;
  goto write_descriptor;
 write_descriptor_return_0:
  arg0K0 = (Sfirst_stobS);
  goto L4559;}
 L4559: {
  stob_105X = arg0K0;
  if ((3 == (3 & stob_105X))) {
    location_106X = table_ref((Sstob_tableS), stob_105X);
    if ((NULL == location_106X)) {
      ps_error("traced stob has no image-table entry", 0);
      goto L4574;}
    else {
      goto L4574;}}
  else {
    table_107X = s48_symbol_table();
    merged_arg0K0 = (*((long *) ((((char *) (-3 + table_107X))) + -4)));
    write_descriptor_return_tag = 1;
    goto write_descriptor;
   write_descriptor_return_1:
    arg0K0 = 0;
    goto L3554;}}
 L4574: {
  if ((3 == (3 & stob_105X))) {
    if ((13 == (31 & ((((*((long *) ((((char *) (-3 + stob_105X))) + -4))))>>2))))) {
      merged_arg0K0 = 1078;
      write_descriptor_return_tag = 2;
      goto write_descriptor;
     write_descriptor_return_2:
      thing_108X = *((long *) (((char *) (-3 + stob_105X))));
      if ((3 == (3 & thing_108X))) {
        v_109X = table_ref((Sstob_tableS), thing_108X);
        if ((NULL == v_109X)) {
          merged_arg0K0 = 1;
          write_descriptor_return_tag = 3;
          goto write_descriptor;
         write_descriptor_return_3:
          goto L4576;}
        else {
          goto L4305;}}
      else {
        goto L4305;}}
    else {
      goto L4311;}}
  else {
    goto L4311;}}
 L3554: {
  i_110X = arg0K0;
  if ((i_110X == ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + table_107X))) + -4))))>>8))))>>2)))) {
    v_111X = s48_imported_bindings();
    merged_arg0K0 = v_111X;
    write_shared_table_return_tag = 0;
    goto write_shared_table;
   write_shared_table_return_0:
    v_112X = s48_exported_bindings();
    merged_arg0K0 = v_112X;
    write_shared_table_return_tag = 1;
    goto write_shared_table;
   write_shared_table_return_1:
    merged_arg0K0 = (10 + ((((Sresumer_countS))<<10)));
    write_descriptor_return_tag = 4;
    goto write_descriptor;
   write_descriptor_return_4:
    arg0K0 = (Sfirst_stobS);
    goto L4654;}
  else {
    link_113X = *((long *) ((((char *) (-3 + table_107X))) + (((i_110X)<<2))));
    if ((0 == (3 & link_113X))) {
      arg0K0 = (3 + (-4 & link_113X));
      goto L3564;}
    else {
      arg0K0 = link_113X;
      goto L3564;}}}
 L4576: {
  arg0K0 = (location_106X->next);
  goto L4559;}
 L4305: {
  thing_114X = *((long *) (((char *) (-3 + stob_105X))));
  if ((3 == (3 & thing_114X))) {
    have_115X = table_ref((Sstob_tableS), thing_114X);
    if ((NULL == have_115X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L4369;}
    else {
      goto L4369;}}
  else {
    merged_arg0K0 = thing_114X;
    write_descriptor_return_tag = 5;
    goto write_descriptor;
   write_descriptor_return_5:
    goto L4576;}}
 L4311: {
  if ((3 == (3 & stob_105X))) {
    if ((6 == (31 & ((((*((long *) ((((char *) (-3 + stob_105X))) + -4))))>>2))))) {
      header_116X = *((long *) ((((char *) (-3 + stob_105X))) + -4));
      merged_arg0K0 = header_116X;
      write_descriptor_return_tag = 6;
      goto write_descriptor;
     write_descriptor_return_6:
      merged_arg0K0 = 0;
      write_descriptor_return_tag = 7;
      goto write_descriptor;
     write_descriptor_return_7:
      start_117X = (((char *) (-3 + stob_105X))) + 4;
      arg3K0 = start_117X;
      goto L3061;}
    else {
      goto L4315;}}
  else {
    goto L4315;}}
 L4654: {
  stob_118X = arg0K0;
  if ((3 == (3 & stob_118X))) {
    location_119X = table_ref((Sstob_tableS), stob_118X);
    v_120X = resumer_recordP(stob_118X);
    if (v_120X) {
      merged_arg0K0 = (location_119X->new_descriptor);
      write_descriptor_return_tag = 8;
      goto write_descriptor;
     write_descriptor_return_8:
      goto L4666;}
    else {
      goto L4666;}}
  else {
    have_121X = (Simage_buffer_pointerS) - (Simage_bufferS);
    if ((0 < have_121X)) {
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_121X));
        goto L5153;}
      else {
        goto L5153;}}
    else {
      goto L5116;}}}
 L3564: {
  symbol_122X = arg0K0;
  arg0K0 = symbol_122X;
  goto L3598;}
 L4369: {
  merged_arg0K0 = (have_115X->new_descriptor);
  write_descriptor_return_tag = 9;
  goto write_descriptor;
 write_descriptor_return_9:
  goto L4576;}
 L3061: {
  addr_123X = arg3K0;
  if ((addr_123X == (start_117X + (-4 + (-4 & (3 + ((long)(((unsigned long)header_116X)>>8)))))))) {
    ps_write_string("Channel closed in dumped image: ", (stderr));
    id_124X = *((long *) ((((char *) (-3 + stob_105X))) + 4));
    if ((0 == (3 & id_124X))) {
      ps_write_integer((((id_124X)>>2)), (stderr));
      goto L3038;}
    else {
      ps_write_string((((char *)(((char *) (-3 + id_124X))))), (stderr));
      goto L3038;}}
  else {
    thing_125X = *((long *) addr_123X);
    if ((3 == (3 & thing_125X))) {
      have_126X = table_ref((Sstob_tableS), thing_125X);
      if ((NULL == have_126X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L3075;}
      else {
        goto L3075;}}
    else {
      arg0K0 = thing_125X;
      goto L3066;}}}
 L4315: {
  if ((3 == (3 & stob_105X))) {
    if ((1 == (31 & ((((*((long *) ((((char *) (-3 + stob_105X))) + -4))))>>2))))) {
      link_127X = *((long *) ((((char *) (-3 + stob_105X))) + 4));
      if ((0 == (3 & link_127X))) {
        arg0K0 = (3 + (-4 & link_127X));
        goto L3997;}
      else {
        arg0K0 = link_127X;
        goto L3997;}}
    else {
      goto L4319;}}
  else {
    goto L4319;}}
 L4666: {
  arg0K0 = (location_119X->next);
  goto L4654;}
 L5153: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto L5116;}
 L5116: {
  table_128X = Sstob_tableS;
  values_129X = table_128X->values;
  keys_130X = table_128X->keys;
  arg0K0 = 0;
  goto L5171;}
 L3598: {
  next_131X = arg0K0;
  if ((3 == (3 & next_131X))) {
    v_132X = table_ref((Sstob_tableS), next_131X);
    if ((NULL == v_132X)) {
      link_133X = *((long *) ((((char *) (-3 + next_131X))) + 4));
      if ((0 == (3 & link_133X))) {
        arg0K0 = (3 + (-4 & link_133X));
        goto L3598;}
      else {
        arg0K0 = link_133X;
        goto L3598;}}
    else {
      arg0K0 = next_131X;
      goto L3566;}}
  else {
    arg0K0 = next_131X;
    goto L3566;}}
 L3038: {
  { long ignoreXX;
  PS_WRITE_CHAR(10, (stderr), ignoreXX) }
  goto L4576;}
 L3075: {
  arg0K0 = (have_126X->new_descriptor);
  goto L3066;}
 L3066: {
  v_134X = arg0K0;
  merged_arg0K0 = v_134X;
  write_descriptor_return_tag = 10;
  goto write_descriptor;
 write_descriptor_return_10:
  arg3K0 = (addr_123X + 4);
  goto L3061;}
 L3997: {
  symbol_135X = arg0K0;
  arg0K0 = symbol_135X;
  goto L4030;}
 L4319: {
  if ((3 == (3 & stob_105X))) {
    if ((14 == (31 & ((((*((long *) ((((char *) (-3 + stob_105X))) + -4))))>>2))))) {
      link_136X = *((long *) ((((char *) (-3 + stob_105X))) + 12));
      if ((0 == (3 & link_136X))) {
        arg0K0 = (3 + (-4 & link_136X));
        goto L3840;}
      else {
        arg0K0 = link_136X;
        goto L3840;}}
    else {
      goto L4323;}}
  else {
    goto L4323;}}
 L5171: {
  i_137X = arg0K0;
  if ((i_137X == (table_128X->size))) {
    free(keys_130X);
    free(values_129X);
    free(table_128X);
    free((Simage_bufferS));
    return (SstatusS);}
  else {
    if ((0 == (*(keys_130X + i_137X)))) {
      goto L5173;}
    else {
      free((*(values_129X + i_137X)));
      goto L5173;}}}
 L3566: {
  thing_138X = arg0K0;
  if ((3 == (3 & thing_138X))) {
    have_139X = table_ref((Sstob_tableS), thing_138X);
    if ((NULL == have_139X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L3617;}
    else {
      goto L3617;}}
  else {
    arg0K0 = thing_138X;
    goto L3568;}}
 L4030: {
  next_140X = arg0K0;
  if ((3 == (3 & next_140X))) {
    v_141X = table_ref((Sstob_tableS), next_140X);
    if ((NULL == v_141X)) {
      link_142X = *((long *) ((((char *) (-3 + next_140X))) + 4));
      if ((0 == (3 & link_142X))) {
        arg0K0 = (3 + (-4 & link_142X));
        goto L4030;}
      else {
        arg0K0 = link_142X;
        goto L4030;}}
    else {
      arg0K0 = next_140X;
      goto L3999;}}
  else {
    arg0K0 = next_140X;
    goto L3999;}}
 L3840: {
  shared_143X = arg0K0;
  arg0K0 = shared_143X;
  goto L3889;}
 L4323: {
  header_144X = *((long *) ((((char *) (-3 + stob_105X))) + -4));
  start_145X = ((char *) (-3 + stob_105X));
  merged_arg0K0 = header_144X;
  write_descriptor_return_tag = 11;
  goto write_descriptor;
 write_descriptor_return_11:
  if ((2 == (3 & header_144X))) {
    if (((31 & (((header_144X)>>2))) < 17)) {
      goto L4339;}
    else {
      size_146X = -4 & (3 + ((long)(((unsigned long)header_144X)>>8)));
      available_147X = 4096 - ((Simage_buffer_pointerS) - (Simage_bufferS));
      if ((available_147X < size_146X)) {
        if ((4096 < size_146X)) {
          have_148X = (Simage_buffer_pointerS) - (Simage_bufferS);
          if ((0 < have_148X)) {
            if (((SstatusS) == NO_ERRORS)) {
              SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_148X));
              goto L2889;}
            else {
              goto L2889;}}
          else {
            goto L2863;}}
        else {
          merged_arg3K0 = start_145X;
          merged_arg0K1 = available_147X;
          copy_image_data_return_tag = 0;
          goto copy_image_data;
         copy_image_data_return_0:
          merged_arg3K0 = (start_145X + available_147X);
          merged_arg0K1 = (size_146X - available_147X);
          copy_image_data_return_tag = 1;
          goto copy_image_data;
         copy_image_data_return_1:
          goto L4576;}}
      else {
        merged_arg3K0 = start_145X;
        merged_arg0K1 = size_146X;
        copy_image_data_return_tag = 2;
        goto copy_image_data;
       copy_image_data_return_2:
        goto L4576;}}}
  else {
    goto L4339;}}
 L5173: {
  arg0K0 = (1 + i_137X);
  goto L5171;}
 L3617: {
  arg0K0 = (have_139X->new_descriptor);
  goto L3568;}
 L3568: {
  value_149X = arg0K0;
  if ((3 == (3 & value_149X))) {
    arg0K0 = (-4 & value_149X);
    goto L3570;}
  else {
    arg0K0 = value_149X;
    goto L3570;}}
 L3999: {
  next_150X = arg0K0;
  header_151X = *((long *) ((((char *) (-3 + stob_105X))) + -4));
  merged_arg0K0 = header_151X;
  write_descriptor_return_tag = 12;
  goto write_descriptor;
 write_descriptor_return_12:
  start_152X = ((char *) (-3 + stob_105X));
  arg3K0 = start_152X;
  goto L4059;}
 L3889: {
  next_153X = arg0K0;
  if ((3 == (3 & next_153X))) {
    v_154X = table_ref((Sstob_tableS), next_153X);
    if ((NULL == v_154X)) {
      link_155X = *((long *) ((((char *) (-3 + next_153X))) + 12));
      if ((0 == (3 & link_155X))) {
        arg0K0 = (3 + (-4 & link_155X));
        goto L3889;}
      else {
        arg0K0 = link_155X;
        goto L3889;}}
    else {
      arg0K0 = next_153X;
      goto L3842;}}
  else {
    arg0K0 = next_153X;
    goto L3842;}}
 L4339: {
  arg3K0 = start_145X;
  goto L4441;}
 L2889: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto L2863;}
 L2863: {
  if (((SstatusS) == NO_ERRORS)) {
    SstatusS = (ps_write_block((Simage_portS), ((char *) start_145X), size_146X));
    goto L4576;}
  else {
    goto L4576;}}
 L3570: {
  v_156X = arg0K0;
  merged_arg0K0 = v_156X;
  write_descriptor_return_tag = 13;
  goto write_descriptor;
 write_descriptor_return_13:
  arg0K0 = (1 + i_110X);
  goto L3554;}
 L4059: {
  addr_157X = arg3K0;
  if ((addr_157X == (start_152X + (-4 + (-4 & (3 + ((long)(((unsigned long)header_151X)>>8)))))))) {
    if ((3 == (3 & next_150X))) {
      have_158X = table_ref((Sstob_tableS), next_150X);
      if ((NULL == have_158X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L4089;}
      else {
        goto L4089;}}
    else {
      arg0K0 = next_150X;
      goto L4012;}}
  else {
    thing_159X = *((long *) addr_157X);
    if ((3 == (3 & thing_159X))) {
      have_160X = table_ref((Sstob_tableS), thing_159X);
      if ((NULL == have_160X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L4073;}
      else {
        goto L4073;}}
    else {
      arg0K0 = thing_159X;
      goto L4064;}}}
 L3842: {
  next_161X = arg0K0;
  header_162X = *((long *) ((((char *) (-3 + stob_105X))) + -4));
  merged_arg0K0 = header_162X;
  write_descriptor_return_tag = 14;
  goto write_descriptor;
 write_descriptor_return_14:
  start_163X = ((char *) (-3 + stob_105X));
  arg3K0 = start_163X;
  goto L3918;}
 L4441: {
  addr_164X = arg3K0;
  if ((addr_164X == (start_145X + (-4 & (3 + ((long)(((unsigned long)header_144X)>>8))))))) {
    goto L4576;}
  else {
    thing_165X = *((long *) addr_164X);
    if ((3 == (3 & thing_165X))) {
      have_166X = table_ref((Sstob_tableS), thing_165X);
      if ((NULL == have_166X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L4455;}
      else {
        goto L4455;}}
    else {
      arg0K0 = thing_165X;
      goto L4446;}}}
 L4089: {
  arg0K0 = (have_158X->new_descriptor);
  goto L4012;}
 L4012: {
  value_167X = arg0K0;
  if ((3 == (3 & value_167X))) {
    merged_arg0K0 = (-4 & value_167X);
    write_descriptor_return_tag = 15;
    goto write_descriptor;
   write_descriptor_return_15:
    goto L4576;}
  else {
    merged_arg0K0 = value_167X;
    write_descriptor_return_tag = 16;
    goto write_descriptor;
   write_descriptor_return_16:
    goto L4576;}}
 L4073: {
  arg0K0 = (have_160X->new_descriptor);
  goto L4064;}
 L4064: {
  v_168X = arg0K0;
  merged_arg0K0 = v_168X;
  write_descriptor_return_tag = 17;
  goto write_descriptor;
 write_descriptor_return_17:
  arg3K0 = (addr_157X + 4);
  goto L4059;}
 L3918: {
  addr_169X = arg3K0;
  if ((addr_169X == (start_163X + (-8 + (-4 & (3 + ((long)(((unsigned long)header_162X)>>8)))))))) {
    x_170X = *((long *) ((((char *) (-3 + stob_105X))) + 4));
    if ((5 == x_170X)) {
      arg0K0 = 529;
      goto L3867;}
    else {
      thing_171X = *((long *) ((((char *) (-3 + stob_105X))) + 8));
      if ((3 == (3 & thing_171X))) {
        have_172X = table_ref((Sstob_tableS), thing_171X);
        if ((NULL == have_172X)) {
          ps_error("traced object has no descriptor in image", 0);
          goto L3979;}
        else {
          goto L3979;}}
      else {
        arg0K0 = thing_171X;
        goto L3867;}}}
  else {
    thing_173X = *((long *) addr_169X);
    if ((3 == (3 & thing_173X))) {
      have_174X = table_ref((Sstob_tableS), thing_173X);
      if ((NULL == have_174X)) {
        ps_error("traced object has no descriptor in image", 0);
        goto L3932;}
      else {
        goto L3932;}}
    else {
      arg0K0 = thing_173X;
      goto L3923;}}}
 L4455: {
  arg0K0 = (have_166X->new_descriptor);
  goto L4446;}
 L4446: {
  v_175X = arg0K0;
  merged_arg0K0 = v_175X;
  write_descriptor_return_tag = 18;
  goto write_descriptor;
 write_descriptor_return_18:
  arg3K0 = (addr_164X + 4);
  goto L4441;}
 L3867: {
  v_176X = arg0K0;
  merged_arg0K0 = v_176X;
  write_descriptor_return_tag = 19;
  goto write_descriptor;
 write_descriptor_return_19:
  if ((3 == (3 & next_161X))) {
    have_177X = table_ref((Sstob_tableS), next_161X);
    if ((NULL == have_177X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L3955;}
    else {
      goto L3955;}}
  else {
    arg0K0 = next_161X;
    goto L3871;}}
 L3979: {
  arg0K0 = (have_172X->new_descriptor);
  goto L3867;}
 L3932: {
  arg0K0 = (have_174X->new_descriptor);
  goto L3923;}
 L3923: {
  v_178X = arg0K0;
  merged_arg0K0 = v_178X;
  write_descriptor_return_tag = 20;
  goto write_descriptor;
 write_descriptor_return_20:
  arg3K0 = (addr_169X + 4);
  goto L3918;}
 L3955: {
  arg0K0 = (have_177X->new_descriptor);
  goto L3871;}
 L3871: {
  value_179X = arg0K0;
  if ((3 == (3 & value_179X))) {
    merged_arg0K0 = (-4 & value_179X);
    write_descriptor_return_tag = 21;
    goto write_descriptor;
   write_descriptor_return_21:
    goto L4576;}
  else {
    merged_arg0K0 = value_179X;
    write_descriptor_return_tag = 22;
    goto write_descriptor;
   write_descriptor_return_22:
    goto L4576;}}
 write_shared_table: {
  table_53X = merged_arg0K0;{
  merged_arg0K0 = (*((long *) ((((char *) (-3 + table_53X))) + -4)));
  write_descriptor_return_tag = 23;
  goto write_descriptor;
 write_descriptor_return_23:
  arg0K0 = 0;
  goto L3464;}
 L3464: {
  i_180X = arg0K0;
  temp_181X = i_180X == ((((3 + ((long)(((unsigned long)(*((long *) ((((char *) (-3 + table_53X))) + -4))))>>8))))>>2));
  if (temp_181X) {
    write_shared_table0_return_value = temp_181X;
    goto write_shared_table_return;}
  else {
    link_182X = *((long *) ((((char *) (-3 + table_53X))) + (((i_180X)<<2))));
    if ((0 == (3 & link_182X))) {
      arg0K0 = (3 + (-4 & link_182X));
      goto L3474;}
    else {
      arg0K0 = link_182X;
      goto L3474;}}}
 L3474: {
  shared_183X = arg0K0;
  arg0K0 = shared_183X;
  goto L3508;}
 L3508: {
  next_184X = arg0K0;
  if ((3 == (3 & next_184X))) {
    v_185X = table_ref((Sstob_tableS), next_184X);
    if ((NULL == v_185X)) {
      link_186X = *((long *) ((((char *) (-3 + next_184X))) + 12));
      if ((0 == (3 & link_186X))) {
        arg0K0 = (3 + (-4 & link_186X));
        goto L3508;}
      else {
        arg0K0 = link_186X;
        goto L3508;}}
    else {
      arg0K0 = next_184X;
      goto L3476;}}
  else {
    arg0K0 = next_184X;
    goto L3476;}}
 L3476: {
  thing_187X = arg0K0;
  if ((3 == (3 & thing_187X))) {
    have_188X = table_ref((Sstob_tableS), thing_187X);
    if ((NULL == have_188X)) {
      ps_error("traced object has no descriptor in image", 0);
      goto L3527;}
    else {
      goto L3527;}}
  else {
    arg0K0 = thing_187X;
    goto L3478;}}
 L3527: {
  arg0K0 = (have_188X->new_descriptor);
  goto L3478;}
 L3478: {
  value_189X = arg0K0;
  if ((3 == (3 & value_189X))) {
    arg0K0 = (-4 & value_189X);
    goto L3480;}
  else {
    arg0K0 = value_189X;
    goto L3480;}}
 L3480: {
  v_190X = arg0K0;
  merged_arg0K0 = v_190X;
  write_descriptor_return_tag = 24;
  goto write_descriptor;
 write_descriptor_return_24:
  arg0K0 = (1 + i_180X);
  goto L3464;}
 write_shared_table_return:
  switch (write_shared_table_return_tag) {
  case 0: goto write_shared_table_return_0;
  default: goto write_shared_table_return_1;
  }}

 write_descriptor: {
  descriptor_52X = merged_arg0K0;{
  *((long *) (Simage_buffer_pointerS)) = (long) (descriptor_52X);
  Simage_buffer_pointerS = ((Simage_buffer_pointerS) + 4);
  if ((4096 == ((Simage_buffer_pointerS) - (Simage_bufferS)))) {
    have_191X = (Simage_buffer_pointerS) - (Simage_bufferS);
    if ((0 < have_191X)) {
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_191X));
        goto L2140;}
      else {
        goto L2140;}}
    else {
      goto write_descriptor_return;}}
  else {
    goto write_descriptor_return;}}
 L2140: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto write_descriptor_return;}
 write_descriptor_return:
  switch (write_descriptor_return_tag) {
  case 0: goto write_descriptor_return_0;
  case 1: goto write_descriptor_return_1;
  case 2: goto write_descriptor_return_2;
  case 3: goto write_descriptor_return_3;
  case 4: goto write_descriptor_return_4;
  case 5: goto write_descriptor_return_5;
  case 6: goto write_descriptor_return_6;
  case 7: goto write_descriptor_return_7;
  case 8: goto write_descriptor_return_8;
  case 9: goto write_descriptor_return_9;
  case 10: goto write_descriptor_return_10;
  case 11: goto write_descriptor_return_11;
  case 12: goto write_descriptor_return_12;
  case 13: goto write_descriptor_return_13;
  case 14: goto write_descriptor_return_14;
  case 15: goto write_descriptor_return_15;
  case 16: goto write_descriptor_return_16;
  case 17: goto write_descriptor_return_17;
  case 18: goto write_descriptor_return_18;
  case 19: goto write_descriptor_return_19;
  case 20: goto write_descriptor_return_20;
  case 21: goto write_descriptor_return_21;
  case 22: goto write_descriptor_return_22;
  case 23: goto write_descriptor_return_23;
  default: goto write_descriptor_return_24;
  }}

 copy_image_data: {
  start_50X = merged_arg3K0;
  size_51X = merged_arg0K1;{
  memcpy((void *)(Simage_buffer_pointerS), (void *)start_50X,size_51X);
  Simage_buffer_pointerS = ((Simage_buffer_pointerS) + size_51X);
  if ((4096 == ((Simage_buffer_pointerS) - (Simage_bufferS)))) {
    have_192X = (Simage_buffer_pointerS) - (Simage_bufferS);
    if ((0 < have_192X)) {
      if (((SstatusS) == NO_ERRORS)) {
        SstatusS = (ps_write_block((Simage_portS), ((char *) (Simage_bufferS)), have_192X));
        goto L2165;}
      else {
        goto L2165;}}
    else {
      goto copy_image_data_return;}}
  else {
    goto copy_image_data_return;}}
 L2165: {
  Simage_buffer_pointerS = (Simage_bufferS);
  goto copy_image_data_return;}
 copy_image_data_return:
  switch (copy_image_data_return_tag) {
  case 0: goto copy_image_data_return_0;
  case 1: goto copy_image_data_return_1;
  default: goto copy_image_data_return_2;
  }}

}void
s48_write_image_init(void)
{
SstatusS = NO_ERRORS;
}
